<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<!--客户信息 start-->
<form id="customerJson">
    <%--<div class="dggui-panel">--%>
        <h4 class="tit-sm">客户信息</h4>
        <table class="dggui-table-info">
            <tbody>
            <tr>
                <th>客户名称：</th>
                <td>
                    <input type="text" name="customerName" readonly id="customerName" class="dggui-input" value="${customer.customerName}">
                </td>
                <th>客户电话：</th>
                <td>
                    <input type="text" name="customerPhone" readonly id="customerPhone" class="dggui-input" value="${customer.customerPhone}">
                    <c:if test="${userEntitys.id eq productOrderFlowUserId}">
                        <d:hasUrlAuth authCode="RZSC_SHOW_PHONE">
                            <i class="iconfont icon-chaxunxinxi" style="display: inline-block;cursor:pointer; " onclick="showNumberV3('rzsc_detail','${customer.customerId}','${customerPhone}')" title="查看号码"></i>
                        </d:hasUrlAuth>
                   </c:if>
                </td>
                <th>身份证号：</th>
                <td>
                    <input type="text" class="dggui-input" readonly name="idCard"id="idCard" value="${customer.idCard}">
                    <c:if test="${userEntitys.id eq productOrderFlowUserId}">
                        <d:hasUrlAuth authCode="RZSC_SHOW_PHONE">
                            <i class="iconfont icon-chaxunxinxi" style="display: inline-block;cursor:pointer; " onclick="showIdCustomerCare('${customer.id}')" title="查看身份证号码"></i>
                        </d:hasUrlAuth>
                   </c:if>
                </td>
                <th>客户性别：</th>
                <td><input type="text" class="dggui-input" readonly  name="sex"id="sex" value="${customer.sex}"></td>
            </tr>
            <tr>
                <th>客户年龄：</th>
                <td><input type="text" class="dggui-input" readonly  name="age" id="age" value="${customer.age}"></td>
                <th>生日：</th>
                <td><input type="text" class="dggui-input" readonly  name="birthday" id="birthday" value="${customer.birthday}"></td>
                <th>户口所在地：</th>
                <td><input type="text" class="dggui-input" readonly  name="registeredResidence" id="registeredResidence" value="${customer.registeredResidence}"></td>
                <th>客户学历：</th>
                <td><input type="text" class="dggui-input" readonly  name="eduBackground" id="eduBackground" value="${customer.eduBackground}"></td>
            </tr>
            <tr>
                <th> 客户婚姻状况：</th>
                <td><input type="text" class="dggui-input" readonly  name="maritalStatus" id="maritalStatus" value="${customer.maritalStatus}"></td>
                <th>客户子女个数：</th>
                <td><input type="text" class="dggui-input" readonly  name="childrenNum" id="childrenNum"value="${customer.childrenNum}"></td>
                <th> 客户地址：</th>
                <td><input type="text" class="dggui-input" readonly  name="address" id="address" value="${customer.address}"></td>
                <th>邮箱：</th>
                <td><input type="text" class="dggui-input" readonly  name="email" id="email" value="${customer.email}"></td>
            </tr>
            </tbody>
        </table>
    <%--</div>--%>
</form>
<!--客户信息 end-->
<!--合同约定 start-->
<%--<div class="dggui-panel">--%>
    <h4 class="tit-sm">合同约定</h4>
    <form id="contractForm">
        <table class="dggui-table-info">
            <tbody>
            <tr>
                <th>需求总金额：</th>
                <td>
                    <div class="unit-warp">
                        <input type="text" class="dggui-input" readonly  value="${orderJson.loansAmount}" name="loansAmount" id="loansAmount">
                        <span class="unit">元</span>
                    </div>
                </td>
                <th>贷款年限：</th>
                <td>
                    <div class="units-warp">
                        <input type="text" class="dggui-input" readonly  name="loansNum" id="loansNum" value="${orderJson.loansNum}">
                        <div class="units">年
                            <input type="text" class="dggui-input" readonly  name="loansRateType" id="loansRateType" value="${orderJson.loansRateType}" style="width: 60px;min-width: auto;margin-left: 5px;">
                        </div>
                    </div>
                </td>
                <th>贷款利息：</th>
                <td>
                    <div class="unit-warp">
                        <input type="text" class="dggui-input" readonly  name="loansInterest" id="loansInterest" value="${orderJson.loansInterest}">
                        <span class="unit">%</span>
                    </div>
                </td>
            </tr>
            <tr>
                <th>定金：</th>
                <td>
                    <div class="unit-warp">
                        <input type="text" class="dggui-input" readonly  name="earnestMoney" id="earnestMoney" value="${orderJson.earnestMoney}">
                        <span class="unit">元</span>
                    </div>
                </td>
                <th>抵押物地址：</th>
                <td colspan="3">
                    <div class="unit-warp"  style="max-width: none">
                        <input type="text" class="dggui-input" readonly  name="mortgageAddress" id="mortgageAddress" value="${orderJson.mortgageAddress}"  style="max-width: none">
                    </div>
                </td>
            </tr>
        </table>
    </form>
<%--</div>--%>
<!--合同约定 end-->
<!--成本费 start-->
<%--<div class="dggui-panel">--%>
    <h4 class="tit-sm">成本费</h4>
    <form id="subjectForm">
        <table class="dggui-table cell-border table-form">
            <thead>
            <th>科目</th>
            <th>数量</th>
            <th>价格(元)</th>
            </thead>
            <tbody>
            <c:if test="${! empty orderSubjectList}">
                <c:forEach items="${orderSubjectList}" var="subject">
                    <tr>
                        <td>${subject.subjectType}</td>
                        <td>${subject.subjectNumStr}</td>
                        <td>${subject.subjectAmount}</td>
                    </tr>
                </c:forEach>
            </c:if>
            </tbody>
        </table>
    </form>
<%--</div>--%>
<!--成本费 end-->
<script>
    dggui.use(['dggdate'],function () {
    });
    /**
     * 查看身份证号码
     */
    function showIdCustomerCare(id){
        var scproductOrderId = $("#product_sc_order_id").val();
        $.ajax({
            type: "get",
            url: sysInfo.basePath + '/order_detail/get_customerCard_by_id.do',
            data: {
                id: id
            },
            dataType: 'json',
            success:function(result){
                if(result.code == '0'){
                    var numberCiphertext = result.data;
                    if("" != numberCiphertext && null != numberCiphertext){
                        dggui.dialog.succeed(numberCiphertext,5*1000);
                        $.ajax({
                            type: "post",
                            url: sysInfo.basePath + "/check_record/save_check_record.do",
                            data: {
                                contactId: id,
                                scproductId: scproductOrderId,
                                operaterType: '1',
                                remarks: '查看客户身份证号码',
                                tableName: 'rzsc_order_customer'
                            },
                            dataType: 'json',
                            success: function (data){
                                console.log(data);
                            }
                        });
                    } else {
                        dggui.dialog.errors("暂无身份证号码");
                    }
                }else{
                    dggui.dialog.errors(result.msg);
                }
            },
            error:function(error){
                dggui.dialog.errors('服务器异常，请联系管理员')
            }
        });

    }
</script>